import request from '@/utils/request'
/**
 * 登录
*/
export function login(data) {
  return request({
    url: '/user/admin/login',
    method: 'post',
    data
  })
}
/**
 * 获取登录token
*/
export function getInfo(token) {
  return request({
    url: '/user/info',
    method: 'get',
    params: { token }
  })
}
/**
 * 退出登录
*/
export function logout() {
  return request({
    url: '/user/logout',
    method: 'get'
  })
}
/**
 * 获取用户
*/
export function getUsers(params) {
  return request({
    url: '/user/admin/list_user',
    method: 'get',
    params
  })
}

/**
 * 新增用户
*/
export function addUsers(data) {
  return request({
    url: '/user/admin/add_user',
    method: 'post',
    data
  })
}

/**
 * 删除用户
*/
export function deleteUsers(data) {
  return request({
    url: '/user/admin/delete_user',
    method: 'post',
    data
  })
}

/**
 * 封禁用户
*/
export function banUsers(data) {
  return request({
    url: '/user/admin/ban_user',
    method: 'post',
    data
  })
}

/**
 * 修改用户
*/
export function resetUsers(data) {
  return request({
    url: '/user/admin/reset_user',
    method: 'post',
    data
  })
}

